﻿using System;
using BusinessLogic.Models.ValidationAttributes;
using Interfaces.Models;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace BusinessLogic.Models.LogicModels.Security
{
    public class Session : ISession
    {
        [NotNullValidator(Tag = RulesKeys.Required)]
        public Guid Id { get; set; }

        [NotNullValidator(Tag = RulesKeys.Required)]
        public DateTime CreatedDate { get; set; }

        [NotNullValidator(Tag = RulesKeys.Required)]
        public DateTime ChangeDate { get; set; }
        
        [ObjectValidator]
        public IUser User { get; set; }

        public Session()
        {
            CreatedDate = DateTime.Now;
            ChangeDate = DateTime.Now;
        }
    }
}
